program ListT;

{$APPTYPE CONSOLE}

uses
  SysUtils;

type
  pelement=^element;
  element=record
    value: integer;
    next: pelement;
  end;


var
  head: pelement;
  i, n, k: integer;
  fin: textFile;


procedure  Add(var head: pelement; num: integer;);
var
  tmp: pelement;
begin
  tmp:=head;
  new(head);
  head^.value:=num;
  head^.next:=tmp;
end;


procedure DeleteEven(var head: pelement);
var
  current, tmp: pelement;
  count: integer;
begin
  current:=head;

  while (current^.next<>nil) do
  begin
    count:=count+1;
    current:=current^.next;
  end;

  current:=head;

  if (count mod 2<>0) then
  begin
    while (current^.next<>nil) do
    begin
      tmp:=current^.next^.next;
      dispose(current^.next);
      current^.next:=tmp;
      current:=tmp;
    end else begin
      tmp:=current^.next^.next;
      dispose(current^.next);
      current^.next:=tmp;
      current:=tmp;
      if (current^.next=nil) then
        dispose(current);

    end;
  end;
end;


procedure More(head: pelement);

var
  current: pelement;

begin
  while (current<>nil) do
  begin
    current^.value:=current^.value+1;
  end;
end;


procedure Delete(head: pelement);

var
  tmp: pelement;

begin
  tmp:=head^.next;
  write(head^.value);
  dispose(head);
  head:=tmp;
end;

begin
  assignFile(fin,'input.txt');
  reset(fin);
  readln(fin,n);

  head:=nil;

  for i:=1 to n do
  begin
    read(fin,k);
    Add(head,k);
  end;

  readln;

  DeleteSecond(head);
  More(head);

  for i:=1 to n do
    Delete(head);

  closeFile(fin);
  readln;

end.

